package com.my.bo.impl;

import java.math.BigInteger;
import java.util.List;

import com.my.bean.Admin;
import com.my.bean.Role;
import com.my.bean.User;
import com.my.bo.AccountBo;

public class AccountBoImpl extends BaseBo implements AccountBo {

	/***************************************** user ***************************************************************************/

	@Override
	public boolean editUser(User user) throws Exception {
		return userdao.editUser(user);
	}

	@Override
	public User getUserById(Class<User> c, Integer id) throws Exception {
		return userdao.getUserById(c, id);
	}

	@Override
	public boolean addUser(User user) throws Exception {
		return userdao.addUser(user);
	}

	@Override
	public BigInteger getTotalUserRecords() throws Exception {
		return userdao.getTotalUserRecords();
	}

	@Override
	public List<User> getAllUserByPage(int pageindex, int pagesize)
			throws Exception {
		return userdao.getAllUserByPage(pageindex, pagesize);
	}

	@Override
	public BigInteger searchTotalUserRecords(User user) throws Exception {
		return userdao.searchTotalUserRecords(user);
	}

	@Override
	public List<User> searchUserByPage(int pageindex, int pagesize, User user)
			throws Exception {
		return userdao.searchUserByPage(pageindex, pagesize, user);
	}

	@Override
	public boolean removeUser(Integer id) throws Exception {
		return userdao.removeUser(id);
	}

	@Override
	public Admin checkLoginAdmin(Admin admin) {
		return admindao.checkLogin(admin);
	}

	@Override
	public boolean isExistAdmin(String name) {
		return admindao.isExist(name);
	}

	@Override
	public boolean addAdmin(Admin admin) throws Exception {
		return admindao.addAdmin(admin);
	}

	@Override
	public boolean editAdmin(Admin admin) throws Exception {
		return admindao.editAdmin(admin);
	}

	@Override
	public Admin getAdminById(Class<Admin> c, Integer id) throws Exception {
		return admindao.getAdminById(c, id);
	}

	@Override
	public BigInteger getTotalAdminRecords() throws Exception {
		return admindao.getTotalAdminRecords();
	}

	@Override
	public List<Admin> getAllAdminByPage(int pageindex, int pagesize)
			throws Exception {
		return admindao.getAllAdminByPage(pageindex, pagesize);
	}

	@Override
	public boolean removeAdmin(Integer id) throws Exception {
		return admindao.removeAdmin(id);
	}

	@Override
	public BigInteger searchTotalAdminRecords(Admin admin) throws Exception {
		return admindao.searchTotalAdminRecords(admin);
	}

	@Override
	public List<Admin> searchAdminByPage(int pageindex, int pagesize,
			Admin admin) throws Exception {
		return admindao.searchAdminByPage(pageindex, pagesize, admin);
	}

	@Override
	public List<Role> getRoleList() throws Exception {
		return roledao.getRoleList();
	}

}
